-- the debug mode
if is_mode("debug") then
    
    -- enable the debug symbols
    set_symbols("debug")

    -- disable optimization
    set_optimize("none")

    add_defines("DEBUG")
end

-- the release mode
if is_mode("release") then

    -- set the symbols visibility: hidden
    set_symbols("hidden")

    -- enable fastest optimization
    set_optimize("fastest")

    -- strip all symbols
    set_strip("all")
end

add_cxflags("-EHsc", "/Zc:sizedDealloc-")

-- define target
target("TransServer")

    -- set kind
    set_kind("binary")

    add_includedirs("TransServer", "../third_party")
    add_includedirs("../third_party/JetByteTools")
    add_files("../third_party/JetByteTools/*.cpp")

    -- add files
    add_files("TransServer/**.cpp")

    if is_arch("x86") then
        add_defines("ARCH86")
    elseif is_arch("x64") then
        add_defines("ARCH64")
    end

    add_links("dbghelp")

target_end()

-- define target
target("client")

    -- set kind
    set_kind("binary")

    -- add files
    add_files("client/**.cpp")

    add_links("ws2_32")

    if is_arch("x86") then
        add_defines("ARCH86")
    elseif is_arch("x64") then
        add_defines("ARCH64")
    end

target_end()